package com.hhs.storage.controller;


import com.hhs.storage.bean.Region;
import com.hhs.storage.bean.ResponseInfo;
import com.hhs.storage.service.RegionService;
import com.hhs.storage.util.SysUtil;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hhs
 * @since 2023-02-04
 */
@RestController
@RequestMapping("/region")
public class RegionController {

    @Resource
    RegionService regionService;
    @RequestMapping("/fj")
    public Map<String,Object> fj(){
        return ResponseInfo.success(SysUtil.FJ_REGION);
    }

    @RequestMapping("/edit")
    public Map<String,Object> addOrEdit(Region region){
        return regionService.addOrEdit(region);
    }

    @DeleteMapping(value = "{id}")
    public Map<String, Object> dele(@PathVariable("id") String id) {

        return regionService.dele(id);

    }

}

